import React from 'react';
import { Menu } from 'antd';
import { useNavigate } from 'react-router-dom';

const MenuCom = (props) => {
  const nav = useNavigate()
  console.log('props',props)
  const clickMenuItem = (e) => {
    nav(e.key)
  }
  return (
    <>
      <Menu onClick={clickMenuItem} theme={props.theme} mode={props.mode} defaultSelectedKeys={props.defaultSelectedKeys} items={props.items} ></Menu>
    </>
  );
};

export default MenuCom;